import QtQuick
import QtQuick.Window
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Controls.Basic

Button {
    id: control
    font.bold: true
    font.pixelSize: 14

    // property color normalColor: "#3498DB"
    // property color hoverColor: "#2980B9"
    // property color pressedColor: "#1F618D"

    contentItem: Text {
        text: control.text
        font: control.font
        opacity: enabled ? 1.0 : 0
        color: '#FFFFFFFF'
        horizontalAlignment: Text.AlignHCenter
        verticalAlignment: Text.AlignVCenter
        elide: Text.ElideRight
    }

    background: Rectangle {
        implicitWidth: 100
        implicitHeight: 40
        opacity: enabled ? 1 : 0.3
        // border.color: control.down ? "#17a81a" : "#21be2b"
        // border.width: 1
        // radius: 4
        color: '#ededed'
        MouseArea {
            anchors.fill: parent
            hoverEnabled: true
            onEntered: parent.color = '#e1e1e1' // 鼠标悬停时的颜色
            onExited: parent.color = '#ededed' // 鼠标离开时的颜色
        }
    }
}
